<%@page import="com.lei.session.util.PremissionUtil"%>
<%@page import="com.lei.session.constant.UserConstant"%>
<%@page import="java.util.List"%>
<%@page import="com.lei.session.entity.Permission"%>
<%@page import="com.lei.sqlJsp.entity.Page"%>
<%@page import="com.lei.sqlJsp.entity.GoodsEntity"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
		Page<GoodsEntity> shopList=(Page<GoodsEntity>) request.getAttribute("goodsOne");
		List<Permission> premissionList = (List<Permission>)session.getAttribute(UserConstant.USER_PRESSION);
	%>
	<%="数据量"+shopList.getCount() %>
	<%
		if(PremissionUtil.checkPremission(premissionList, "add")){
	%>
		<a href="newSql/add.jsp">添加</a>
	<%		
		}
	 %>
	
	<table border="1">
		<tr>
			<td>id</td>
			<td>商品编号</td>
			<td>商品名称</td>
			<td>删除标识</td>
			<td>创建时间</td>
			<td>修改时间</td>
			<td>创建者</td>>
			<td>修改者</td>
			<td>操做</td>
			<%
				for (GoodsEntity myshop : shopList.getData()) {
			%>
		
		<tr>
			<td><%=myshop.getId()%></td>
			<td><%=myshop.getShopNumber()%></td>
			<td><%=myshop.getShopName()%></td>
			<td><%=myshop.getDeleteLogo()%></td>
			<td><%=myshop.getCreationTime()%></td>
			<td><%=myshop.getUpdateTime()%></td>
			</td>
			<td width='150px'><a
				href="GoodsServlet?method=delete&id=<%=myshop.getId()%>">删除</a>&nbsp;&nbsp;
			 <a href="GoodsServlet?method=toUpdate&id=<%=myshop.getId()%>">修改</a></td>
		</tr>
		<%
			}
		%>
	</table>
	<%
		for (int i = 1; i <= shopList.getTotalPage(); i++) {
			if (i == shopList.getCurrentPage()) {
				//abc"
				String abc = "abc\"";
				out.print("  " + i);
			} else {
				out.print("  <a href =\"GoodsServlet?method=list&currentPage=" + i + "\">" + i + "</a>");

			}
		}
	%>
</body>
</html>